package com.winning.pmph.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;

import javax.persistence.Table;

@Table(name = "book_source_file")
@Data
public class BookSourceFile extends BaseEntity {
    private static final long serialVersionUID = 1L;
    /**
     * 文件未导入
     */
    public static final int BOOK_IMPORT_STATUS_UNIMPORTED = 0;
    /**
     * 文件导入失败
     */
    public static final int BOOK_IMPORT_STATUS_FAILED = 1;
    /**
     * 文件导入成功
     */
    public static final int BOOK_IMPORT_STATUS_IMPORTED = 2;
    /**
     * 文件正在导入
     */
    public static final int BOOK_IMPORT_STATUS_IMPORTING = 3;

    /**
     * 源文件未删除
     */
    public static final int SOURCE_FILE_EXIST = 0;
    /**
     * 源文件被删除
     */
    public static final int SOURCE_FILE_DELETED = 1;

    @TableId
    private String id;

    /**
     * 图书ID
     */
    private String bookId;
    
    /**
     * 文件名称
     */
    private String name;

    /**
     * 状态
     * <p>
     * {@code BOOK_IMPORT_STATUS_UNIMPORTED}：未导入。（默认状态）
     * {@code BOOK_IMPORT_STATUS_IMPORTED}：导入成功。
     * {@code BOOK_IMPORT_STATUS_FAILED}：导入失败。
     */
    private int status;

    /**
     * 原文件存储路径
     */
    private String path;

    /**
     * 源文件是否删除
     * <p>
     * {@code SOURCE_FILE_EXIST}：源文件未被删除
     * {@code SOURCE_FILE_DELETED}: 源文件被删除
     */
    private int deleted;

    private String failureReason;

    @TableField(exist = false)
    private String analysisPath;

}
